﻿<Page
    x:Name="pageRoot"
    x:Class="TranshumanityNet.ItemsPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TranshumanityNet"
    xmlns:data="using:TranshumanityNet.DataModel"
    xmlns:common="using:TranshumanityNet.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>
        <!-- Collection of items displayed by this page -->
        <CollectionViewSource
            x:Name="itemsViewSource"
            Source="{Binding Items}"
            d:Source="{Binding Groups, Source={d:DesignData Source=/DataModel/SampleData.json, Type=data:SampleDataSource}}"/>
    </Page.Resources>
 
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
 
        <GridView
            x:Name="itemGridView"
            AutomationProperties.AutomationId="ItemsGridView"
            AutomationProperties.Name="Items"
            TabIndex="1"
            Grid.RowSpan="3"
            Padding="116,136,116,46"
            ItemsSource="{Binding Source={StaticResource itemsViewSource}}"
            SelectionMode="None"
            IsSwipeEnabled="false"
            IsItemClickEnabled="True"
            ItemClick="ItemView_ItemClick">
            <GridView.ItemTemplate>
                <DataTemplate>
                    <Grid HorizontalAlignment="Left" Width="150" Height="180">
                        <Border Background="{ThemeResource ListViewItemPlaceholderBackgroundThemeBrush}">
                            <Image Source="{Binding ImagePath}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
                        </Border>
                        <StackPanel VerticalAlignment="Bottom" Background="{ThemeResource ListViewItemOverlayBackgroundThemeBrush}">
                            <TextBlock Text="{Binding Title}" Foreground="{ThemeResource ListViewItemOverlayForegroundThemeBrush}" Style="{StaticResource BaseTextBlockStyle}" Height="60" Margin="15,0,15,0" FontWeight="SemiBold"/>
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </GridView.ItemTemplate>
        </GridView>
 
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Margin="39,59,39,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
                        Style="{StaticResource NavigationBackButtonNormalStyle}"
                        VerticalAlignment="Top"
                        AutomationProperties.Name="Back"
                        AutomationProperties.AutomationId="BackButton"
                        AutomationProperties.ItemType="Navigation Button"/>
            <TextBlock x:Name="pageTitle" Style="{StaticResource HeaderTextBlockStyle}" Grid.Column="1" 
                        IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40">
            	<Run Text="transhumanity.net"/>
            </TextBlock>
        </Grid>
    </Grid>
    <!--<Page.BottomAppBar  >
        <AppBar Padding="10,0,10,0" IsSticky="True" IsOpen="True" >
            <Grid Margin="110,0,100,0">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <Grid Height="65" Width="150" Background="#293955">
                        <Rectangle Width="5" Height="65" Fill="#2c3b94" HorizontalAlignment="Left" />
                        <TextBlock x:Name="SingularityIndex" Text="+2%, 345pts" Margin="10,5,5,5" FontSize="24" />
                        <TextBlock Text="singularity index" Margin="55,40,5,5" FontSize="12" />
                    </Grid>
                    <Grid Height="65" Width="150" Background="#293955" Margin="10,0,0,0">
                        <Rectangle Width="5" Height="65" Fill="#465a7d" HorizontalAlignment="Left" />
                        <TextBlock Text="News Source" Margin="10,5,5,5" FontSize="24" />
                        <TextBlock Text="Composite" Margin="85,40,5,5" FontSize="12" />
                    </Grid>
                </StackPanel>

                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >

                </StackPanel>
            </Grid>
        </AppBar>
    </Page.BottomAppBar>-->
</Page>
